package com.lrkj.waitress.service.impl;

import java.util.List;
import com.lrkj.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.lrkj.waitress.mapper.PathDetailMapper;
import com.lrkj.waitress.domain.PathDetail;
import com.lrkj.waitress.service.IPathDetailService;

/**
 * 路线明细Service业务层处理
 *
 * @author yajun_ren
 * @date 2022-03-23
 */
@Service
public class PathDetailServiceImpl implements IPathDetailService
{
    @Autowired
    private PathDetailMapper pathDetailMapper;

    /**
     * 查询路线明细
     *
     * @param id 路线明细ID
     * @return 路线明细
     */
    @Override
    public PathDetail selectPathDetailById(String id)
    {
        return pathDetailMapper.selectPathDetailById(id);
    }

    /**
     * 查询路线明细列表
     *
     * @param pathDetail 路线明细
     * @return 路线明细
     */
    @Override
    public List<PathDetail> selectPathDetailList(PathDetail pathDetail)
    {
        return pathDetailMapper.selectPathDetailList(pathDetail);
    }

    /**
     * 新增路线明细
     *
     * @param pathDetail 路线明细
     * @return 结果
     */
    @Override
    public int insertPathDetail(PathDetail pathDetail)
    {
        pathDetail.setCreateTime(DateUtils.getNowDate());
        return pathDetailMapper.insertPathDetail(pathDetail);
    }

    /**
     * 修改路线明细
     *
     * @param pathDetail 路线明细
     * @return 结果
     */
    @Override
    public int updatePathDetail(PathDetail pathDetail)
    {
        pathDetail.setUpdateTime(DateUtils.getNowDate());
        return pathDetailMapper.updatePathDetail(pathDetail);
    }

    /**
     * 批量删除路线明细
     *
     * @param ids 需要删除的路线明细ID
     * @return 结果
     */
    @Override
    public int deletePathDetailByIds(String[] ids)
    {
        return pathDetailMapper.deletePathDetailByIds(ids);
    }

    /**
     * 删除路线明细信息
     *
     * @param id 路线明细ID
     * @return 结果
     */
    @Override
    public int deletePathDetailById(String id)
    {
        return pathDetailMapper.deletePathDetailById(id);
    }

    @Override
    public int deletePathId(String pathId) {
        return pathDetailMapper.deletePathId(pathId);
    }

    /**
     * 批量新增路线明细信息
     *
     * @param pathDetails 路线明细对象
     */
    public int batchAddData(List<PathDetail> pathDetails)
    {
           return pathDetailMapper.batchAddData(pathDetails);
    }
}
